#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "WriteVariableAction.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class InputPin;

/// <summary>
/// AddVariableValueAction
/// An AddVariableValueAction is a WriteVariableAction for adding values to a
/// Variable.
/// </summary>
class UMLMODEL_EXPORT AddVariableValueAction : public WriteVariableAction {

public: // Constructors and destructors
    explicit AddVariableValueAction(const QString& umlType="uml::AddVariableValueAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// insertAt getter
    /// The InputPin that gives the position at which to insert a new value or move an
    /// existing value in ordered Variables. The type of the insertAt InputPin is
    /// UnlimitedNatural, but the value cannot be zero. It is omitted for unordered
    /// Variables.
    /// </summary>
    shared_ptr<InputPin> insertAt() const;

    /// <summary>
    /// insertAt setter
    /// The InputPin that gives the position at which to insert a new value or move an
    /// existing value in ordered Variables. The type of the insertAt InputPin is
    /// UnlimitedNatural, but the value cannot be zero. It is omitted for unordered
    /// Variables.
    /// </summary>
    void setInsertAt(shared_ptr<InputPin> value);

    /// <summary>
    /// isReplaceAll getter
    /// Specifies whether existing values of the Variable should be removed before
    /// adding the new value.
    /// </summary>
    bool isReplaceAll() const;

    /// <summary>
    /// isReplaceAll setter
    /// Specifies whether existing values of the Variable should be removed before
    /// adding the new value.
    /// </summary>
    void setIsReplaceAll(bool value);

private: // Fields
    /// <summary>
    /// insertAt
    /// The InputPin that gives the position at which to insert a new value or move an
    /// existing value in ordered Variables. The type of the insertAt InputPin is
    /// UnlimitedNatural, but the value cannot be zero. It is omitted for unordered
    /// Variables.
    /// </summary>
    shared_ptr<InputPin> insertAt_;

    /// <summary>
    /// isReplaceAll
    /// Specifies whether existing values of the Variable should be removed before
    /// adding the new value.
    /// </summary>
    const static bool isReplaceAll_default_;
    bool isReplaceAll_= isReplaceAll_default_;

};

} // namespace uml
